<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>邮件管理</title>
    <!-- 引入 Bootstrap CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container mt-5">
    <h2>邮件管理</h2>
    <p>这里是邮件管理的功能页面。</p>
    <button id="sendEmailButton" class="btn btn-primary">发送测试邮件</button>
</div>

<!-- 引入 jQuery -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
    $(document).ready(function () {
        // 点击发送邮件按钮
        $("#sendEmailButton").on("click", function () {
            $.ajax({
                url: "/sendTestEmail", // 后端接口地址
                method: "POST",
                success: function (response) {
                    alert(response); // 显示后端返回的结果
                },
                error: function (error) {
                    console.error("发送邮件失败:", error);
                    alert("发送邮件失败，请检查日志或联系管理员！");
                }
            });
        });
    });
</script>
</body>
</html>